#define _CRT_SECURE_NO_WARNINGS
#include "SList.h"

void SList::Print(SList* head)
{
	if (head)
	{
		SList* cur = head;
		while (cur)
		{
			cout << cur->val << endl;
			cur = cur->next;
		}
	}
}

void SList::PushFront(SList*& head, Element x)
{
	SList* newnode = (SList*)malloc(sizeof(SList));
	if (newnode == nullptr) return;
	newnode->next = head->next;
	head->next = newnode;
	newnode->val = x;
}

